class name
{
String fname;
String lname;
void getdata(String x)
{
fname=x;
}
void getdata(String x,String y)
{
fname=x;
lname=y;
}
void getdata(String x,String y,String z)
{
fname=x;
lname=y;
mname=z;
}
}
class democ8
{
public static void main(String args[])
{
name obj1=new name();
name obj2=new name(); 
name obj3=new name();
obj1.getdata("samir");
obj2.getdata("mishra,hari");
obj3.getdata("harihar,hariom,ram");
System.out.println(obj1.fname);
System.out.println(obj1.fname+" "+obj2.fname);
System.out.println(obj1.fname+" "+obj2.lname+" "+obj3.mname);
}
}

